<template>
  <div class="tableListPage">
    <!-- 搜索区域 -->
    <div class="tableListSearch">
      <exception-search @clickbtn="handleSearch"></exception-search>
    </div>
    <!-- 列表区域 -->
    <div class="tableListMain commonTableSty" style="height:calc(100% - 90px)">
      <exception-table-list ref="exceptionTableComp" @operateRow="handleRowOperation" ></exception-table-list>
    </div>
  </div>
</template>
<script>
import ExceptionSearch from './components/ExceptionSearch.vue'
import ExceptionTableList from './components/ExceptionTableList.vue'

export default {
  components: {
    ExceptionSearch,
    ExceptionTableList
  },
  computed: {},
  data () {
    return {}
  },
  created () {},
  mounted () {},
  methods: {
    // 查询表格数据
    handleSearch () {
      this.$refs.exceptionTableComp.refreshData(true)
    },
    // 表格传递上来的事件
    handleRowOperation (data) {
      // 按照type分发事件
      this[data[0]](data[1])
    },
    // 审核流程查看
    auditProcess (data) {
      this.$router.push({ path: '/todo/applicationContent',
        query: {
          id: data.instanceId,
          swcode: data.businessCode,
          key: data.businessKey,
          toReview:1,
          // 是从我的申请跳转过去还是从我的审核跳转过去，会影响底部的操作信息栏加载
          aorr: 'a',
          status: data.instanceStatus } })
    }
  }
}
</script>
<style lang="less" scoped>
.tableListPage {
  height: 100%;
  overflow: hidden;
  .tableListAction {
    margin-top: 16px;
    button {
      margin-right: 16px;
      &:nth-last-child(1) {
        margin-right: 0;
      }
    }
  }
  .tableListMain {
    margin-top: 16px;
  }
}
</style>
